home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11829 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.1 KB  |  67 lines

  1. Newsgroups: comp.os.linux.misc,comp.lang.c,comp.unix.admin,comp.security.unix
  2. Path: netcom.com!henderso
  3. From: henderso@netcom.com (Mark C. Henderson)
  4. Subject: Re: binaries (generated from "C" code)
  5. Message-ID: <hendersoDovvs3.20G@netcom.com>
  6. Organization: Netcom
  7. References: <4j7pge$9ga@xanadu.io.com>
  8. Date: Tue, 26 Mar 1996 16:43:14 GMT
  9. Sender: henderso@netcom16.netcom.com
  10.  
  11. In article <4j7pge$9ga@xanadu.io.com>, Casey Claiborne <mskc@io.com> wrote:
  12. >Hello,
  13. >    I have a question that I am hoping someone out there can
  14. >help me with. I have a binary that was generated using "C" code.
  15. >Is there any way that I can ensure that the binary generated will
  16. >run on one machine? I have heard that some vendors use licensing
  17. >but I am not exactly sure how this works. Any advice, help or
  18. >hints on the matter would be *greatly* appreciated :)
  19.  
  20. Well, the trick is to have some sort of key based upon a unique identifier
  21. for the machine. Most commercial UNIX systems give you a call to get
  22. some sort of serial number which, in theory, is unique to the machine.
  23.  
  24. One simple way to do this is to build yourself a hash function based
  25. upon MD5, SHS, or something similar. Then make a licence file with
  26. the serial number and the hash.
  27.  
  28. e.g.
  29. 123456912     CB5870B1FBA4E4E24392
  30.  
  31. The program can check the serial number of the machine it is running on,
  32. calculate the hash, and validate the key.
  33.  
  34. Of course, this is completely insecure. Folks can just modify the binary
  35. so that the licence checker is not called. Worse, they can generate
  36. a valid key by spying on the program with a debugger. But the expensive
  37. commercial schemes generally also have these flaws. You also need to
  38. trust the operating system (something not under the programs control)
  39. to report the correct serial number. This assumption can be fatal
  40. (e.g. see http://www.squirrel.com/squirrel/sun-stuff/change-sun-hostid.tar.gz
  41. for Sun/Solaris examples which allow you to alter this serial number as 
  42. reported by the OS).
  43.  
  44. Of course, you could do a lot better. Perhaps use an encryption function
  45. to generate the key, and don't embed it in the code for the binary. This
  46. way our cracker has to try to reverse your decryption function. Also
  47. initialise a few critical constants in your licence verification routine. 
  48. This way, if someone tries to bypass it, the program will malfunction.
  49.  
  50. See, 
  51. ftp://utopia.hacktic.nl/pub/replay/pub/cracking/license.asc.gz
  52. for some information on how to make such a scheme harder to crack.
  53.  
  54. There are no guarantees, but if you are willing to put some work into
  55. making this sort of thing more secure, you can, at least, make it so that
  56. the potential crackers has a few hours of work ahead of him/her.
  57.  
  58. The other alternative is to go with a dongle. People also have ways of
  59. getting around them, and they are generally very annoying, especially if
  60. your customer has to use more than one.
  61.  
  62. -- 
  63. Mark Henderson -- markh@wimsey.bc.ca, henderso@netcom.com (personal accounts)
  64. ViaCrypt PGP Key Fingerprint: 21 F6 AF 2B 6A 8A 0B E1  A1 2A 2A 06 4A D5 92 46
  65. http://www.squirrel.com/squirrel/ - change-sun-hostid, unstrip for Solaris, 
  66.  computer security, TECO, FGMP, Sun NVRAM/hostid FAQ, Wimsey crypto archive
  67.